﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Psn2a00
    {
		private string _empno;
		private string _empname;
		private string _dlistid;
        private int? _depno;
		private string _depname;
		private string _jobname;
		private string _sex;
        private DateTime? _birthday;
		private string _birthplace;
		private string _birthadd;
		private string _tel;
		private string _address;
		private double _nowmoney;
        private DateTime? _cdate;
		private string _usercode;
		private string _listid;
		
        /// <summary>
        /// 工号
        /// </summary>
		public string Empno
		{
			get { return _empno;	 }
			set { _empno=value;	}
		}
        /// <summary>
        /// 姓名
        /// </summary>
		public string Empname
		{
			get { return _empname;	 }
			set { _empname=value;	}
		}
        /// <summary>
        /// 部门标识
        /// </summary>
		public string Dlistid
		{
			get { return _dlistid;	 }
			set { _dlistid=value;	}
		}
        /// <summary>
        /// 部门编码
        /// </summary>
		public int? Depno
		{
			get { return _depno;	 }
			set { _depno=value;	}
		}
        /// <summary>
        /// 部门名称
        /// </summary>
		public string Depname
		{
			get { return _depname;	 }
			set { _depname=value;	}
		}
        /// <summary>
        /// 职位名称
        /// </summary>
		public string Jobname
		{
			get { return _jobname;	 }
			set { _jobname=value;	}
		}
        /// <summary>
        /// 1:男；0女
        /// </summary>
		public string Sex
		{
			get { return _sex;	 }
			set { _sex=value;	}
		}
        /// <summary>
        /// 出生日期
        /// </summary>
		public DateTime? Birthday
		{
			get { return _birthday;	 }
			set { _birthday=value;	}
		}
        /// <summary>
        /// 籍贯
        /// </summary>
		public string Birthplace
		{
			get { return _birthplace;	 }
			set { _birthplace=value;	}
		}
        /// <summary>
        /// 户籍地址
        /// </summary>
		public string Birthadd
		{
			get { return _birthadd;	 }
			set { _birthadd=value;	}
		}
        /// <summary>
        /// 联系电话
        /// </summary>
		public string Tel
		{
			get { return _tel;	 }
			set { _tel=value;	}
		}
        /// <summary>
        /// 住址
        /// </summary>
		public string Address
		{
			get { return _address;	 }
			set { _address=value;	}
		}
        /// <summary>
        /// 当前薪资
        /// </summary>
		public double Nowmoney
		{
			get { return _nowmoney;	 }
			set { _nowmoney=value;	}
		}
        /// <summary>
        /// 入职日期
        /// </summary>
		public DateTime? Cdate
		{
			get { return _cdate;	 }
			set { _cdate=value;	}
		}
        /// <summary>
        /// 用户名
        /// </summary>
		public string Usercode
		{
			get { return _usercode;	 }
			set { _usercode=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Psn2a00> GetPsn2a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Psn2a00> list = new List<Psn2a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Psn2a00 model = GetPsn2a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Psn2a00 GetPsn2a00ByDataRow(DataRow dr)
		{
			Psn2a00 model = new Psn2a00(); //实例化Psn2a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("empno")&&!(dr["empno"] is System.DBNull))  
				model.Empno = ( string)dr["empno"];
			if (dcc.Contains("empname")&&!(dr["empname"] is System.DBNull))  
				model.Empname = ( string)dr["empname"];
			if (dcc.Contains("dlistid")&&!(dr["dlistid"] is System.DBNull))  
				model.Dlistid = ( string)dr["dlistid"];
			if (dcc.Contains("depno")&&!(dr["depno"] is System.DBNull))  
				model.Depno = ( int)dr["depno"];
			if (dcc.Contains("depname")&&!(dr["depname"] is System.DBNull))  
				model.Depname = ( string)dr["depname"];
			if (dcc.Contains("jobname")&&!(dr["jobname"] is System.DBNull))  
				model.Jobname = ( string)dr["jobname"];
			if (dcc.Contains("sex")&&!(dr["sex"] is System.DBNull))  
				model.Sex = ( string)dr["sex"];
			if (dcc.Contains("birthday")&&!(dr["birthday"] is System.DBNull))  
				model.Birthday = ( DateTime)dr["birthday"];
			if (dcc.Contains("birthplace")&&!(dr["birthplace"] is System.DBNull))  
				model.Birthplace = ( string)dr["birthplace"];
			if (dcc.Contains("birthadd")&&!(dr["birthadd"] is System.DBNull))  
				model.Birthadd = ( string)dr["birthadd"];
			if (dcc.Contains("tel")&&!(dr["tel"] is System.DBNull))  
				model.Tel = ( string)dr["tel"];
			if (dcc.Contains("address")&&!(dr["address"] is System.DBNull))  
				model.Address = ( string)dr["address"];
			if (dcc.Contains("nowmoney")&&!(dr["nowmoney"] is System.DBNull))  
				model.Nowmoney = Convert.ToDouble(dr["nowmoney"]);
			if (dcc.Contains("cdate")&&!(dr["cdate"] is System.DBNull))  
				model.Cdate = ( DateTime)dr["cdate"];
			if (dcc.Contains("usercode")&&!(dr["usercode"] is System.DBNull))  
				model.Usercode = ( string)dr["usercode"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
